FROM golang:alpine AS builder

WORKDIR /usr/local/app/
COPY . /usr/local/app/
RUN go env -w GOPROXY=https://goproxy.cn,direct \
    && go mod tidy \
    && go build -o assets_rpc assets-rpc/rpc.go

FROM alpine:latest

WORKDIR /usr/local/app/

COPY --from=builder  /usr/local/app/assets_rpc ./
COPY --from=builder  /usr/local/app/assets-rpc/etc/assets-rpc.yaml ./
RUN chmod +x assets_rpc
EXPOSE 30010
ENTRYPOINT ["./assets_rpc"]
CMD ["-f", "assets-rpc.yaml"]
